package com.gitee.zw.irmp.common.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class OpenApiConfig {

    @Bean
    public OpenAPI springShopOpenAPI(@Value("${spring.application.name}") String appName,
                                     @Value("${spring.application.version:1.0}") String appVersion) {
        return new OpenAPI()
                .info(new Info().title(appName).version(appVersion.replaceAll("@", "")));
    }
}
